<!---剪贴板复制 start-->
<script type="text/javascript" src="__PUBLIC__/copy2/jquery-1.js"></script>
<script src="http://cdn.bootcss.com/zerocl...
<script type="text/javascript">

var client = new ZeroClipboard($('.copy'));
client.on('ready', function (event) {
    client.on('copy', function (event) {
        var id = $(event.target).attr('data-id');
        var content = $.trim($('#fe_text_' + id).val());
        event.clipboardData.setData('text/plain', content);
    });

    client.on('aftercopy', function (event) {
        //layer.msg('已经复制到粘贴板!', {icon: 1, time: 1500,});
        alert("复制成功");
    });
});

</script>

举例:

<tr>
  <th scope="col">ID</th>
  <th scope="col">类型/名称</th>
  <th scope="col">推广链接</th>
  <th scope="col">推广文案</th>
  <th scope="col">标签</th>
  <th scope="col">收入明细</th>
</tr>

<volist name="result" id="vo">

<tr>
  <td>{$vo.id}</td>
  <td>[{$vo.type_name}]{$vo.subject}</td>
  <td><input type="text" class="copylj" value="{$vo.new_href}" id="fe_text_{$vo.id}" readonly>
  <span id="clip_button"  data-id="{$vo.id}" style="cursor: pointer;" class="copy fr">复制</span></td>
  <td><a class="down-btn" href="__MODULE__/Center/download/id/{$vo.id}">下载</a></td>
  <td>{$vo.mark_name}</td>
  <td><a class="look-btn" href="__MODULE__/Center/look/id/{$vo.id}">查看</a></td>
</tr>

</volist>
</tbody>
</table>


葡萄酒不吐葡萄皮
1.1k 声望74 粉丝

just do It